<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title><spring:message code="message.lable.DICqiYeZiZhiLeiXingWeiHuJiLu"/></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
<!--[if lt IE 9]>
    <script src="lib/js/html5shiv.min.js"></script>
    <script src="lib/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.lable.DICqiYeZiZhiLeiXingWeiHuJiLu"/></h1>
        <ol class="breadcrumb">
          <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.DicManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.entprofileDic"/></a></li>
        </ol>
    </section>
    <section class="content">
        <div class="box box-success">
            <div class="box-body">
                <div class="form-inline">
                    <div class="form-group form-group-xs">
                        <label><spring:message code="message.listForm.xiuGaiRiQi"/>：</label>
                        <input class="form-control" id = "startDate" type="text" placeholder="yyyy-MM-dd" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}'})" data-date-fmt="yyyy-MM-dd" />
                        <label>-</label>
                        <input class="form-control" id = "endDate" type="text" placeholder="yyyy-MM-dd" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}'})" data-date-fmt="yyyy-MM-dd" />
                    </div>
                    <button type="button" onclick="likeQuery();"class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class="box box-warning bottongroup">
             <a href="${ctx }/dicEntProfile/toEntProfileList.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
        </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
        $(function () {
            
            $("#gridlist").jqGrid({
                url: "getDicEntProfileLogList.html",
                mtype: "post",
                datatype: "json",
                postData:{"dicEntProfileId":"${dicEntProfileId}"},
                autowidth: true,
                height: 270,
                colNames: ['',
                           '<spring:message code="message.jqGrid.cz"/>',
                           '<spring:message code="message.listForm.xiuGaiXiangQing"/>',
                           '企业资质类型编码','企业资质类型名称','状态',
                           '<spring:message code="message.listForm.xiuGaiRen"/>',
                           '<spring:message code="message.listForm.xiuGaiShiJian"/>'
                           ],
                colModel: [
					{ name: 'logId', width: 120 , align: "center",hidden:true},
					{ name: 'operate', width: 10, align:"center", sortable: false,
						formatter : function(val, opts, rowdata) {
					    	var str =  "";
								str += "<a href='${ctx}/dicEntProfileLog/toEntProfileLogDetail.html?logId="+rowdata.logId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
					    	return str;
					}},
					{ name: 'detail', width : 200, align : "left", sortable:false  },
					{ name: 'firstLevelIndiCode', hidden:true, width: 80, align:"center", sortable: false},
					{ name: 'firstLevelIndiName',  hidden:true,width: 120 , align: "center"},
                    { name: 'status',  hidden:true, width: 60, align: "center",
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.status == 1){
                    			strSta += "<spring:message code="message.button.start"/>";
                    		}else{
                    			strSta += "<spring:message code="message.button.stop"/>";
                    		}
                    		return strSta;
                    	}	
                    },
                    { name: 'updUser',  width: 30, align: "left" },
                    { name: 'updDatetime',  width: 35, align: "left"}
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "${firstLevelIndiCode} - ${firstLevelIndiName}&nbsp;<spring:message code="message.jqGrid.cz.weiHuJiLuLieBiao"/> ",
                jsonReader: {
                    repeatitems: false,
                    id: "ids"
                },
                gridComplete: function(){
                	var page = $("#gridlist").jqGrid('getGridParam','page');
            		var rows = $('#gridlist').getGridParam("rowNum");
            		var maxnum = (rows*page).toString();
            		var len = (maxnum.length)*10;
            		$('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                	$('#gridlist_rn').css('width',len+'px');
                }

            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        
        function likeQuery(){
        	var startDate  = $("#startDate").val();
       	    var endDate = $("#endDate").val();
       	 $("#gridlist").jqGrid('setGridParam', { 
       		 	url: "${pageContext.request.contextPath}/dicEntProfileLog/getDicEntProfileLogList.html", 
                postData:{
               		 "startDate":startDate,
                	 "endDate":endDate
                },
       			 page: 1 
       			 }).trigger("reloadGrid");
        }
        
        
        
    </script>
</body>
</html>